import { Module } from '@nestjs/common';
import { UsersController } from './users.controller';
import { UsersService } from './users.service';
import { DatabaseModule } from '../../database/database.module';
import { User } from '../../database/schemas/user.schema';
import { Constants } from '../../constants/constants';
import { UserSetting } from '../../database/schemas/user-setting.schema';

@Module({
  imports: [DatabaseModule],
  controllers: [UsersController],
  providers: [
    ...DatabaseModule.modelProviders([
      { name: Constants.MODELS.USER, clazz: User },
      { name: Constants.MODELS.USER_SETTING, clazz: UserSetting }
    ]),
    UsersService
  ],
  exports: [UsersService]
})
export class UsersModule {}
